package biz

import (
	"context"
	"time"
)

const (
	FruitTableName = "fruit"
)

type Fruit struct {
	Id         uint32    `gorm:"primaryKey;column:id" json:"id"`
	FruitType  uint32    `gorm:"column:fruit_type" json:"fruit_type"`
	FruitName  string    `gorm:"column:fruit_name" json:"fruit_name"`
	FruitPrice float32   `gorm:"column:fruit_price" json:"fruit_price"`
	CreateAt   time.Time `gorm:"column:create_at;default:null" json:"create_at"`
	UpdateAt   time.Time `gorm:"column:update_at;default:null" json:"update_at"`
}

func (f Fruit) TableName() string {
	return FruitTableName
}

func (gc *GinUsecase) ListFruitsBiz(ctx context.Context) (any, error) {
	return gc.ginRepo.ListFruits(ctx)
}
